<form id="form_customer_showedit" method="post" action="y.php?r=customer/savedata">
    <input type="hidden" name="customer_id" value="">
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" name="customer_name" style="width:100%" data-options="label:'客户姓名:',required:true">
    </div>
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" name="phone" style="width:100%"
               data-options="label:'客户电话:',required:true">
    </div>
    <div style="margin-bottom:20px">
        <select class="easyui-combobox" name="status" label="状态" style="width:100%">
            <option value="无">无</option>
            <option value="潜在">潜在</option>
            <option value="有意向">有意向</option>
            <option value="失败">失败</option>
            <option value="已成交">已成交</option>
        </select>
    </div>
</form>
<div style="text-align:center;padding:5px 0">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">清空</a>
</div>
<script>
    var dataobj = <?php echo json_encode($customer) ?>;
    $(function () {
        $('#form_customer_showedit').form('load',dataobj);
    });
    function submitForm() {
        $('#form_customer_showedit').form('submit',{
            success: function(){
                $('#win_main').window("close");
                $("#customer_list").datagrid("reload");
            }
        });
    }
    function clearForm() {
        $('#form_customer_showedit').form('clear');
        if(dataobj!=null){
            $("input[name=customer_id]").val(dataobj.customer_id);
        }
    }
</script>